import { lazy } from 'react'
import { Navigate } from 'react-router-dom'
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'



const Login = lazy(() => import('../pages/Login/index'))
const Home = lazy(() => import('../pages/Home/index'))
const Order = lazy(() => import('../pages/Order/index'))
const Message = lazy(() => import('../pages/Message/index'))
const Homelouat = lazy(() => import('../pages/Homelouat/index'))
const My = lazy(() => import('../pages/My/index'))
const Xiangqing = lazy(() => import('../pages/Xiangqing/index'))
const Zhuce = lazy(() => import('../pages/Zhuce/index'))
const Diqu =lazy(()=>import('../pages/Diqu/index'))


export const zi = [
    {
        path: '/home',
        element: <Home></Home>,
        title: '首页',
        icon:<FriendsO />
    },
    {
        path: '/my',
        element: <My></My>,
        title: '我的',
        icon:<HomeO />
    },
    {
        path: '/order',
        element: <Order></Order>,
        title: '订单',
        icon:<Search />
    },
    {
        path: '/message',
        element: <Message></Message>,
        title: '信息',
        icon:<SettingO />
    },

]

export const routes = [
    {
        path: '/',
        element: <Homelouat></Homelouat>,
        children: [
            ...zi,
            {
                path: '/',
                element: <Navigate to='/home'></Navigate>
            },
        ]
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '/Zhuce',
        element: <Zhuce></Zhuce>
    },
    {
        path: '/Xiangqing',
        element: <Xiangqing></Xiangqing>
    },
    // Diqu
    {
        path: '/diqu/:type',
        element:<Diqu></Diqu>
    },
]